package ynu.po;

import jakarta.persistence.*;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

@Table(name="user")  //自动建一个名为user的表格
@Data
@Entity

public class UserList {
    @NotBlank(message = "用户名不能为空")  //去除空格
    @Column(name = "username")
    private String userName;

    @Column(name = "sex")
    private Boolean sex;

    @Column(name = "age")
    private Integer age;

    @Column(name = "career")
    private String career;

    @Column(name = "phonenum")
    private Long phonenum;

    @Length(min = 6)
    @Column(name = "password")
    private String password;

    @Email(message = "email格式不正确")
    @Column(name = "email")
    private  String email;

    @Id
    @GeneratedValue
    @Column(name = "userId")
    private Long userId;


}